package com.ztman.router.common.dagger.component;

import com.ztman.router.common.base.MyApplication;
import com.ztman.router.common.core.DataManager;
import com.ztman.router.common.core.db.LitepalHelper;
import com.ztman.router.common.core.http.RetrofitHelper;
import com.ztman.router.common.core.prefer.PreferenceHelperImpl;
import com.ztman.router.common.dagger.module.AppModule;
import com.ztman.router.common.dagger.module.HttpModule;

import javax.inject.Singleton;

import dagger.Component;

/**
 * @Title:AppComponent
 * @Package:com.ztman.router.common.dagger
 * @Description:
 * @Auther:YJH
 * @Email:yuannunhua@gmail.com
 * @Date:2018/5/1014:59
 */
@Singleton
@Component(modules = {AppModule.class, HttpModule.class})
public interface AppComponent {

    /**
     * 功能：对外提供 MyApplication 实例
     * @return myApplication
     */
    MyApplication getContext();


    /**
     * 功能：对外提供 DataManager 实例
     * @return dataManager
     */
    DataManager getDataManager();

    /**
     * 提供http的帮助类
     *
     * @return RetrofitHelper
     */
    RetrofitHelper getRetrofitHelper();

    /**
     * 提供数据库帮助类
     *
     * @return litepalHelper
     */
    LitepalHelper getLitepalHelper();

    /**
     * 提供sp帮助类
     *
     * @return preferencesHelper
     */
    PreferenceHelperImpl getPreferenceHelperImpl();
}
